package com.hsogoo.study.springapplication;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;

/**
 * @Author huangsaigang
 * Created @2019-10-05.
 */
@Configuration
public class SpringApplicationBootstrap {

    public static void main(String[] args) {

        //非web方式启动
        ConfigurableApplicationContext context = new SpringApplicationBuilder(SpringApplicationBootstrap.class)
                .web(WebApplicationType.NONE)
                .run(args);




        //关闭上下文
        context.close();

    }


}
